package com.tudouji.project.weigh.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.weigh.mapper.WeightInterfaceParamMapper;
import com.tudouji.project.weigh.domain.WeightInterfaceParam;
import com.tudouji.project.weigh.service.IWeightInterfaceParamService;

/**
 * 过磅参数接口Service业务层处理
 * 
 * @author tudouji
 * @date 2023-03-22
 */
@Service
public class WeightInterfaceParamServiceImpl implements IWeightInterfaceParamService 
{
    @Autowired
    private WeightInterfaceParamMapper weightInterfaceParamMapper;

    /**
     * 查询过磅参数接口
     * 
     * @param id 过磅参数接口ID
     * @return 过磅参数接口
     */
    @Override
    public WeightInterfaceParam selectWeightInterfaceParamById(Long id)
    {
        return weightInterfaceParamMapper.selectWeightInterfaceParamById(id);
    }

    /**
     * 查询过磅参数接口列表
     * 
     * @param weightInterfaceParam 过磅参数接口
     * @return 过磅参数接口
     */
    @Override
    public List<WeightInterfaceParam> selectWeightInterfaceParamList(WeightInterfaceParam weightInterfaceParam)
    {
        return weightInterfaceParamMapper.selectWeightInterfaceParamList(weightInterfaceParam);
    }

    /**
     * 新增过磅参数接口
     * 
     * @param weightInterfaceParam 过磅参数接口
     * @return 结果
     */
    @Override
    public int insertWeightInterfaceParam(WeightInterfaceParam weightInterfaceParam)
    {
        weightInterfaceParam.setCreateTime(DateUtils.getNowDate());
        return weightInterfaceParamMapper.insertWeightInterfaceParam(weightInterfaceParam);
    }

    /**
     * 修改过磅参数接口
     * 
     * @param weightInterfaceParam 过磅参数接口
     * @return 结果
     */
    @Override
    public int updateWeightInterfaceParam(WeightInterfaceParam weightInterfaceParam)
    {
        weightInterfaceParam.setUpdateTime(DateUtils.getNowDate());
        return weightInterfaceParamMapper.updateWeightInterfaceParam(weightInterfaceParam);
    }

    /**
     * 批量删除过磅参数接口
     * 
     * @param ids 需要删除的过磅参数接口ID
     * @return 结果
     */
    @Override
    public int deleteWeightInterfaceParamByIds(Long[] ids)
    {
        return weightInterfaceParamMapper.deleteWeightInterfaceParamByIds(ids);
    }

    /**
     * 删除过磅参数接口信息
     * 
     * @param id 过磅参数接口ID
     * @return 结果
     */
    @Override
    public int deleteWeightInterfaceParamById(Long id)
    {
        return weightInterfaceParamMapper.deleteWeightInterfaceParamById(id);
    }
}
